import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

/* Layout */
import Layout from "@/layout";

/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
 */
export const constantRoutes = [
  // {
  //   path: "/login",
  //   component: () =>
  //     import(/* webpackChunkName: "login" */ "@/views/login/index"),
  //   hidden: true,
  //   meta: { id: -1 }
  // },
  {
    path: "/_empty",
    component: () =>
      import(/* webpackChunkName: "_empty" */ "@/views/_empty/index"),
    hidden: true,
    meta: { id: -1 }
  },
  // {
  //   path: "/",
  //   // component: Layout,
  //   // redirect: '/tenantManagement',
  //   meta: { perList: [], id: -1, iotName: "tenant" },
  //   component: () =>
  //     import(
  //       /* webpackChunkName: "tenantManagement" */ "@/views/tenant/tenantManagement"
  //     ),
  //   hidden: true
  // },
  {
    path: "/",
    name: "edgeAdmin",
    component: Layout,
    meta: { title: "边缘计算工作台", id: 22 },
    redirect: "/edge",
    children: [
      {
        name: "edge",
        path: "/edge",
        component: () => import(/* webpackChunkName: "edge" */ "@/views/edge"),
        meta: {
          perList: [],
          title: "边缘计算工作台",
          id: 23,
          pid: 22,
          icon: "element-icons el-icongongzuotaimoren",
          breadcrumb: true
        }
      }
    ]
  },
  // 应用中心
  {
    path: "/application-centerAdmin",
    name: "application-centerAdmin",
    component: Layout,
    meta: { title: "应用中心", id: 26 },

    children: [
      {
        name: "application-center",
        path: "/application-center",
        component: () =>
          import(
            /* webpackChunkName: "applicationCenter" */ "@/views/application-center"
          ),
        meta: {
          perList: [],
          title: "应用中心",
          id: 27,
          pid: 26,
          icon: "element-icons el-iconyingyongzhongxin1"
        }
      },
      {
        hidden: true,
        name: "centerDetails",
        path: "/centerDetails",
        component: () =>
          import(
            /* webpackChunkName: "centerDetails" */ "@/views/application-center/centerDetails"
          ),
        meta: {
          perList: [],
          id: 27,
          pid: 26,
          hiddenAPPMain: true,
          title: "应用中心详情",
          icon: "element-icons el-iconyingyongzhongxin1"
        }
      },
      {
        hidden: true,
        name: "historyDataDetails",
        path: "/historyDataDetails",
        component: () =>
          import(
            /* webpackChunkName: "historyDataDetails" */ "@/views/application-center/centerDetails/historyData/historyDataDetails/index.vue"
          ),
        meta: {
          perList: [],
          isBrea: true,
          id: 27,
          pid: 26,
          hiddenAPPMain: true,
          title: "历史任务详情",
          icon: "element-icons el-iconyingyongzhongxin1"
        }
      }
    ]
  }
];
/**
 * asyncRoutes
 * a base page that does not have permission requirements
 * all roles can be accessed
 */
export const asyncRoutes = [
  // 站点管理
  {
    path: "/typeManagement",
    component: Layout,
    redirect: "/opensiteTypeManagement",
    name: "typeManagementAdmin",
    meta: { id: 1, title: "站点管理", icon: "new-typeManagement" },
    alwaysShow: true, // 只有一个一级菜单-也需要展开
    children: [
      {
        path: "/opensiteTypeManagement",
        name: "opensiteTypeManagementName",
        meta: {
          perList: [],
          id: 2,
          pid: 1,
          title: "站点类型",
          icon: "new-opensiteTypeManagement",
          iotName: "areaType"
        },
        component: () =>
          import(/* webpackChunkName: "opensite" */ "@/views/opensite/index")
      },
      {
        path: "/thesite",
        name: "thesite",
        component: () =>
          import(
            /* webpackChunkName: "typeManagement" */ "@/views/thesite/index"
          ),
        hidden: true,

        meta: {
          perList: [],
          title: "站点类型详情",
          id: 2,
          pid: 1,
          iotName: "areaType"
        }
      },
      {
        path: "SiteList",
        name: "SiteList",
        meta: {
          perList: [],
          id: 3,
          pid: 1,
          title: "站点",
          icon: "new-siteList",
          iotName: "area"
        },
        component: () => import("@/views/siteAdmin/SiteList")
      },
      {
        path: "/sitename",
        name: "sitename",
        component: () =>
          import(/* webpackChunkName: "sitename" */ "@/views/sitename/index"),
        hidden: true,
        meta: { perList: [], title: "站点详情", id: 3, pid: 1, iotName: "area" }
      }
    ]
  },

  // 设备管理
  {
    path: "/deviceRouter",
    component: Layout,
    redirect: "/devicetype",
    name: "deviceRouter",
    meta: { title: "设备管理", id: 4, icon: "new-devicesrouter" },
    alwaysShow: true, // 只有一个一级菜单-也需要展开
    children: [
      {
        path: "/devicetype",
        name: "devicetype",
        meta: {
          perList: [],
          title: "设备类型",
          id: 5,
          pid: 4,
          icon: "new-devicetype",
          iotName: "deviceType"
        },
        component: () =>
          import(
            /* webpackChunkName: "devicetype" */ "@/views/device/deviceTypePage/devicetype"
          )
      },
      {
        path: "/devicetypedetails",
        name: "devicetypedetails",
        component: () =>
          import(
            /* webpackChunkName: "devicetypedetails" */ "@/views/device/deviceTypePage/devicetypedetails"
          ),
        hidden: true,
        meta: {
          perList: [],
          title: "设备类型详情",
          id: 5,
          pid: 4,
          iotName: "deviceType"
        }
      },
      {
        path: "/device/devicePage/devices",
        name: "devices",
        component: () =>
          import(
            /* webpackChunkName: "devices" */ "@/views/device/devicePage/devices"
          ),
        meta: {
          perList: [],
          title: "设备",
          id: 6,
          pid: 4,
          icon: "new-devices",
          iotName: "device"
        }
      },
      {
        path: "/device/meterBeOverdue",
        name: "meterBeOverdue",
        component: () =>
          import(
            /* webpackChunkName: "meterBeOverdue" */ "@/views/device/meterBeOverdue/index.vue"
          ),
        meta: {
          perList: [],
          title: "仪表到期管理",
          id: 6,
          pid: 4,
          icon: "new-devices",
          iotName: "device"
        }
      },
      {
        path: "/device/loudspeakerBox",
        name: "loudspeakerBox",
        component: () =>
          import(
            /* webpackChunkName: "devices" */ "@/views/device/loudspeakerBox"
          ),
        meta: {
          perList: [],
          title: "音箱管理",
          id: 6,
          pid: 4,
          icon: "new-loudspeakerBox",
          iotName: "device"
        }
      },
      {
        path: "/device/camera",
        name: "camera",
        component: () =>
          import(/* webpackChunkName: "devices" */ "@/views/device/camera"),
        meta: {
          perList: [],
          title: "摄像头管理",
          id: 6,
          pid: 4,
          icon: "new-shexiangtou",
          iotName: "device"
        }
      },
      {
        path: "/device/loudspeakerBoxDetails",
        name: "loudspeakerBoxDetails",
        hidden: true,
        component: () =>
          import(
            /* webpackChunkName: "devices" */ "@/views/device/loudspeakerBox/loudspeakerBoxDetails/index"
          ),
        meta: {
          perList: [],
          title: "音箱详情",
          id: 6,
          pid: 4,
          icon: "element-icons el-iconshebeiguanli3",
          iotName: "device"
        }
      },
      {
        path: "/device/devicePage/devicesdetails",
        name: "devicesdetails",
        component: () =>
          import(
            /* webpackChunkName: "devicesdetails" */ "@/views/device/devicePage/devicesdetails"
          ),
        hidden: true,
        meta: {
          perList: [],
          id: 6,
          pid: 4,
          perList: [],
          title: "设备详情",
          iotName: "device"
        }
      },
      {
        path: "/device/devicePage/deviceRunTimeLargeData",
        name: "deviceRunTimeLargeData",
        component: () =>
          import(
            /* webpackChunkName: "deviceRunTimeLargeData" */ "@/views/device/devicePage/deviceRunTimeLargeData"
          ),
        hidden: true,
        meta: { perList: [], id: 6, pid: 4, title: "实时数据" }
      },
      {
        path: "/device/deviceAssignmentsPage/deviceAssignments",
        name: "deviceAssignments",
        component: () =>
          import(
            /* webpackChunkName: "deviceAssignments" */ "@/views/device/deviceAssignmentsPage/deviceAssignments"
          ),
        meta: {
          perList: [],
          title: "设备分配",
          id: 7,
          pid: 4,
          icon: "new-deviceAssignments"
        }
      },
      // {
      //     path: '/device/devicegroups/deviceGroupsList',
      //     name: 'deviceGroupsList',
      //     component: () =>
      //         import(/* webpackChunkName: "deviceGroupsList" */'@/views/device/devicegroups/deviceGroupsList'),
      //     meta: { perList: [], title: '设备组', iotName: 'device', id: 8, pid: 4, icon: 'el-icon-collection' }
      // },
      // {
      //     path: '/deviceTesting',
      //     name: 'deviceTesting',
      //     component: () =>
      //         import(/* webpackChunkName: "deviceTesting" */'@/views/device/deviceTesting'),
      //     meta: { perList: [], title: '设备检测', id: 7, pid: 4, icon: 'element-icons el-iconshebeiguanli3' }
      // },
      {
        path: "/device/deviceAssignmentsPage/deviceAssignmentsDetails",
        name: "deviceAssignmentsDetails",
        component: () =>
          import(
            /* webpackChunkName: "deviceAssignmentsDetails" */ "@/views/device/deviceAssignmentsPage/deviceAssignmentsDetails"
          ),
        hidden: true,
        meta: { perList: [], id: 7, pid: 4, title: "设备分配详情" }
      },

      {
        path: "/device/devicegroups/deviceGroupDetail",
        name: "deviceGroupDetail",
        component: () =>
          import(
            /* webpackChunkName: "deviceGroupDetail" */ "@/views/device/devicegroups/deviceGroupDetail"
          ),
        hidden: true,
        meta: {
          perList: [],
          id: 8,
          pid: 4,
          title: "设备组详情",
          iotName: "device"
        }
      }
    ]
  },

  // 网管管理
  {
    path: "/networkPage",
    name: "networkPage",
    component: Layout,
    meta: { title: "网关管理", id: 9, icon: "new-networkPage" },
    redirect: "/network",
    alwaysShow: true, // 只有一个一级菜单-也需要展开
    children: [
      {
        name: "networkType",
        path: "/networkType",
        component: () =>
          import(
            /* webpackChunkName: "networkType" */ "@/views/network/networkType"
          ),
        meta: {
          perList: [],
          title: "网关类型",
          id: 10,
          pid: 9,
          icon: "new-networkType",
          iotName: "assetType"
        }
      },
      {
        path: "networkType/networkTypDetails",
        name: "networkTypDetails",
        component: () =>
          import(
            /* webpackChunkName: "networkTypDetails" */ "@/views/network/networkType/networkTypDetails"
          ),
        hidden: true,
        meta: {
          perList: [],
          id: 10,
          pid: 9,
          title: "网关类型详情",
          iotName: "assetType"
        }
      },
      {
        name: "network",
        path: "/network",
        component: () =>
          import(/* webpackChunkName: "network" */ "@/views/network/network"),
        meta: {
          perList: [],
          title: "网关",
          id: 11,
          pid: 9,
          icon: "new-network",
          iotName: "asset"
        }
      }
    ]
  },
  // 定时器管理
  {
    path: "/timerAdmin",
    name: "timerAdmin",
    component: Layout,
    meta: {
      perList: [],
      title: "定时器管理",
      id: 12,
      icon: "new-dingshiqiguanli"
    },
    redirect: "/schedules",
    alwaysShow: true, //只有一个一级菜单-也需要展开
    children: [
      {
        path: "/schedules",
        name: "schedules",
        component: () =>
          import(
            /* webpackChunkName: "schedules" */ "@/views/network/timerAdmin/schedules/index"
          ),
        meta: {
          title: "触发器",
          id: 11,
          pid: 9,
          perList: [],
          icon: "new-chufaqi"
        }
      },
      {
        path: "/scheduledJobs",
        name: "scheduledJobs",
        component: () =>
          import(
            /* webpackChunkName: "scheduledJobs" */ "@/views/network/timerAdmin/scheduledJobs/index"
          ),
        meta: {
          title: "定时器",
          id: 23,
          pid: 22,
          perList: [],
          icon: "new-dingshiqi"
        }
      }
    ]
  },
  // 工艺配方
  {
    path: "/processRecipe",
    name: "processRecipe",
    component: Layout,
    meta: { perList: [], title: "工艺管理", id: 12, icon: "new-processRecipe" },
    redirect: "/template/list",
    alwaysShow: true, // 只有一个一级菜单-也需要展开
    children: [
      {
        name: "templateListAdmin",
        path: "/template/list",
        component: () =>
          import(
            /* webpackChunkName: "templateList" */ "@/views/processRecipe/template/index"
          ),
        meta: {
          perList: [],
          title: "工艺模板管理",
          id: 13,
          pid: 12,
          icon: "new-templateListAdmin"
        },
        redirect: "/template/list",
        children: [
          {
            hidden: true,
            name: "templateList",
            path: "/template/list",
            component: () =>
              import(
                /* webpackChunkName: "templateList" */ "@/views/processRecipe/template/list"
              ),
            meta: {
              perList: [],
              title: "工艺模板管理",
              id: 13,
              pid: 12,
              icon: "new-templateListAdmin"
            }
          },
          {
            name: "templateDetail",
            path: "/temDetails/templateDetail",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "templateDetail" */ "@/views/processRecipe/template/templateDetail.vue"
              ),
            meta: {
              perList: [],
              id: 13,
              pid: 12,
              title: "模板管理",
              iotName: "template",
              icon: "element-icons el-icontubiaozhizuomobanyihuifu-"
            }
          }
        ]
      },

      {
        name: "recipeListAdmin",
        path: "recipe/list",
        component: () =>
          import(
            /* webpackChunkName: "recipeList" */ "@/views/processRecipe/recipe/index.vue"
          ),
        meta: {
          perList: [],
          title: "工艺配方管理",
          iotName: "formula",
          id: 15,
          pid: 12,
          icon: "new-recipeListAdmin"
        },
        redirect: "/recipe/list",
        children: [
          {
            name: "recipeList",
            path: "/recipe/list",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "recipeList" */ "@/views/processRecipe/recipe/list"
              ),
            meta: {
              perList: [],
              title: "工艺配方管理",
              iotName: "formula",
              id: 15,
              pid: 12,
              icon: "new-recipeListAdmin"
            }
          },
          {
            name: "recipeDetails",
            path: "/recipeDetails",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "temExhibition" */ "@/views/processRecipe/recipe/Details.vue"
              ),
            meta: {
              perList: [],
              id: 13,
              pid: 12,
              title: "主工艺详情",
              icon: "element-icons el-icontubiaozhizuomobanyihuifu-"
            }
          },
          {
            name: "recipeExhibition",
            path: "/mainList/recipeExhibition",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "recipeExhibition" */ "@/views/processRecipe/recipe/recipeExhibition.vue"
              ),
            meta: {
              id: 15,
              pid: 12,
              perList: [],
              title: "打印预览",
              iotName: "formula",
              icon: "element-icons el-icontubiaozhizuomobanyihuifu-"
            }
          },
          {
            name: "formulaExhibitio",
            path: "/mainList/formulaExhibitio",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "recipeExhibition" */ "@/views/processRecipe/recipe/formulaExhibitio.vue"
              ),
            meta: {
              id: 15,
              pid: 12,
              perList: [],
              title: "打印预览",
              iotName: "formula",
              icon: "element-icons el-icontubiaozhizuomobanyihuifu-"
            }
          }
        ]
      }
    ]
  },
  // 生产任务
  {
    path: "/productionTask",
    name: "productionTask",
    component: Layout,
    meta: { title: "生产任务管理", id: 16, icon: "new-productionTask" },
    redirect: "/productionTask/receive-task/list",
    alwaysShow: true, // 只有一个一级菜单-也需要展开
    children: [
      {
        name: "materialAccount",
        path: "/materialAccount",
        component: () =>
          import(
            /* webpackChunkName: "receiveTask" */ "@/views/productionTask/materialAccount/index"
          ),
        meta: {
          perList: [],
          title: "物料收发台账",
          iotName: "productionTask",
          id: 17,
          pid: 16,
          icon: "new-materialAccount"
        }
      },
      // {
      //   name: 'taskAccount',
      //   path: '/taskAccount',
      //   component: () =>
      //     import(/* webpackChunkName: "receiveTask" */'@/views/productionTask/taskAccount/index'),
      //   meta: { perList: [], title: '物料任务管理', iotName: 'productionTask', id: 17, pid: 16, icon: 'new-taskAccount' }
      // },

      {
        name: "receiveTask",
        path: "receive-task/list",
        component: () =>
          import(
            /* webpackChunkName: "receiveTask" */ "@/views/productionTask/receive-task/index"
          ),
        meta: {
          perList: [],
          title: "生产任务管理",
          iotName: "productionTask",
          id: 17,
          pid: 16,
          icon: "new-receiveTask"
        }
      },
      // {
      //     name: 'furnaceTask',
      //     path: 'furnaceTask/list',
      //     component: () =>
      //         import(/* webpackChunkName: "furnaceTask" */'@/views/productionTask/furnace-task/list'),
      //     meta: { perList: [], title: '合炉任务管理', id: 18, pid: 16, icon: 'element-icons el-iconyingyongzhongxin1' }
      // },
      {
        name: "furnaceRecipe",
        path: "furnaceTask/furnaceRecipeList",
        component: () =>
          import(
            /* webpackChunkName: "furnaceRecipe" */ "@/views/productionTask/furnace-task/recipe/furnaceRecipeList"
          ),
        meta: {
          perList: [],
          title: "合炉任务管理",
          id: 19,
          pid: 16,
          icon: "new-furnaceRecipe"
        }
      },
      {
        name: "jobTask",
        path: "jobTask/list",
        component: () =>
          import(
            /* webpackChunkName: "jobTask" */ "@/views/productionTask/job-task/list"
          ),
        meta: {
          perList: [],
          title: "设备任务列表",
          id: 20,
          pid: 16,
          icon: "new-jobTask"
        }
      },
      {
        name: "furnacerule",
        path: "/furnacerule",
        component: () =>
          import(
            /* webpackChunkName: "receiveTask" */ "@/views/productionTask/furnacerule/index"
          ),
        meta: {
          perList: [],
          title: "合炉规则管理",
          id: 17,
          pid: 16,
          icon: "new-furnacerule"
        }
      }
    ]
  },
  {
    path: "/centralizedControl",
    name: "centralizedControl",
    component: Layout,
    meta: { title: "集中控制中心", id: 22, icon: "new-centralizedControl" },
    // redirect: '/timed',
    alwaysShow: true, // 只有一个一级菜单-也需要展开

    children: [
      {
        path: "/workshopOperation",
        name: "workshopOperation",
        component: () =>
          import(
            /* webpackChunkName: "timed-task" */ "@/views/centralizedControl/workshopOperation/index"
          ),
        meta: {
          title: "车间运营总览",
          id: 23,
          pid: 22,
          icon: "new-workshopOperation",
          hiddenAPPMain: true
        }
      },
      {
        path: "/deviceOperation",
        name: "deviceOperation",
        component: () =>
          import(
            /* webpackChunkName: "timed-task" */ "@/views/centralizedControl/deviceOperation/index"
          ),
        meta: {
          title: "设备运行管理",
          hiddenAPPMain: true,
          id: 23,
          pid: 22,
          icon: "new-deviceOperation"
        },
        // redirect: "/chemical",
        children: [
          {
            path: "/chemical",
            name: "chemical",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "chemical" */ "@/views/centralizedControl/deviceOperation/chemical/index"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/vacuumFurnace",
            name: "vacuumFurnace",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "vacuumFurnace" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/index"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/P300",
            name: "P300",
            hidden: true,
            component: () =>
              import(
                /* P300: "Z2" */ "@/views/centralizedControl/deviceOperation/P300/index.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/P800",
            name: "P800",
            hidden: true,
            component: () =>
              import(
                /* P800: "Z2" */ "@/views/centralizedControl/deviceOperation/P800/index.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z2",
            name: "Z2",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z2" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z2/Z2.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z6",
            name: "Z6",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z6" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z6/Z6.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z16",
            name: "Z16",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z16" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z16/Z16.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z17",
            name: "Z17",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z17" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z17/Z17.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z7",
            name: "Z7",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z7" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z7/Z7.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z8",
            name: "Z8",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z8" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z8/Z8.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z9",
            name: "Z9",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z9" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z9/Z9.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z10",
            name: "Z10",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z10" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z10/Z10.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z11",
            name: "Z11",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z11" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z11/Z11.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z12",
            name: "Z12",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z12" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z12/Z12.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z13",
            name: "Z13",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z13" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z13/Z13.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z14",
            name: "Z14",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z14" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z14/Z14.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z15",
            name: "Z15",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z15" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z15/Z15.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z18",
            name: "Z18",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z18" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z18/Z18.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z19",
            name: "Z19",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z19" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z19/Z19.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z20",
            name: "Z20",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z20" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z20/Z20.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/Z21",
            name: "Z21",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "Z21" */ "@/views/centralizedControl/deviceOperation/vacuumFurnace/Z21/Z21.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          },
          {
            path: "/otherPage",
            name: "otherPage",
            hidden: true,
            component: () =>
              import(
                /* webpackChunkName: "otherPage" */ "@/views/centralizedControl/deviceOperation/otherPage/index.vue"
              ),
            meta: {
              perList: [],
              title: "设备运行管理",
              hiddenAPPMain: true,
              id: 21,
              pid: 21,
              icon: "element-icons el-icondingshirenwuguanli"
            }
          }
        ]
      },
      {
        path: "/giveAnAlarm",
        name: "giveAnAlarm",
        component: () =>
          import(
            /* webpackChunkName: "timed-task" */ "@/views/centralizedControl/giveAnAlarm/index"
          ),
        meta: {
          title: "告警中心",
          hiddenAPPMain: true,
          id: 23,
          pid: 22,
          icon: "new-giveAnAlarm"
        }
      },
      // {
      //   path: "/timeTask",
      //   name: "timeTask",
      //   component: () =>
      //     import(
      //       /* webpackChunkName: "timed-task" */ "@/views/centralizedControl/timeTask/index"
      //     ),
      //   meta: {
      //     title: "出炉提醒管理",
      //     hiddenAPPMain: true,
      //     id: 23,
      //     pid: 22,
      //     icon: "new-timeTask"
      //   }
      // },
      {
        path: "/historicalTasksSearch",
        name: "historicalTasksSearch",
        component: () =>
          import(
            /* webpackChunkName: "timed-task" */ "@/views/centralizedControl/historicalTasksSearch/index"
          ),
        meta: {
          title: "过程数据追溯",
          hiddenAPPMain: true,
          id: 23,
          pid: 22,
          icon: "new-historicalTasksSearch"
        }
      },
      {
        path: "/inspection",
        name: "inspection",
        component: () =>
          import(
            /* webpackChunkName: "inspection" */ "@/views/centralizedControl/inspection/index"
          ),
        meta: {
          title: "生产过程检验",
          hiddenAPPMain: true,
          id: 23,
          pid: 22,
          icon: "new-historicalTasksSearch"
        }
      }
    ]
  },
  {
    path: "/energyConsumptionAdmin",
    name: "energyConsumptionAdmin",
    component: Layout,
    meta: {
      title: "能源能耗管理",
      id: 24,
      icon: "new-energyConsumptionAdmin"
    },
    children: [
      {
        name: "energyAlocation",
        path: "/energyAlocation",
        component: () =>
          import(
            /* webpackChunkName: "applicationCenter" */ "@/views/energyConsumptionAdmin/energyAlocation"
          ),
        meta: {
          perList: [],
          title: "能源配置",
          id: 27,
          pid: 26,
          icon: "new-energyAlocation"
        }
      },
      {
        name: "energyStatistics",
        path: "/energyStatistics",
        component: () =>
          import(
            /* webpackChunkName: "applicationCenter" */ "@/views/energyConsumptionAdmin/energyStatistics"
          ),
        meta: {
          perList: [],
          title: "用能统计",
          id: 27,
          pid: 26,
          icon: "new-energyStatistics"
        }
      },
      {
        name: "energyForm",
        path: "/energyForm",
        component: () =>
          import(
            /* webpackChunkName: "applicationCenter" */ "@/views/energyConsumptionAdmin/energyForm"
          ),
        meta: {
          perList: [],
          title: "能源报表",
          id: 27,
          pid: 26,
          icon: "new-energyForm"
        }
      }
    ]
  },
  // 边缘计算工作台

  // 数字孪生
  // {
  //     path: '/digital-twinAdmin',
  //     name: 'digital-twinAdmin',
  //     component: Layout,
  //     meta: { title: '数字孪生工作台', id: 24, },
  //     children: [{
  //         name: 'digital-twin',
  //         path: '/digital-twin',
  //         component: () =>
  //             import(/* webpackChunkName: "digitalTwin" */'@/views/digital-twin'),
  //         meta: { perList: [], title: '数字孪生工作台', id: 25, pid: 24, icon: 'element-icons el-iconshuzi' }
  //     }]
  // },
  // {
  //   path: "/edgeAdmin",
  //   name: "edgeAdmin",
  //   component: Layout,
  //   meta: { title: "边缘计算工作台", id: 22 },
  //   children: [
  //     {
  //       name: "edge",
  //       path: "/edge",
  //       component: () => import(/* webpackChunkName: "edge" */ "@/views/edge"),
  //       meta: {
  //         perList: [],
  //         title: "边缘计算工作台",
  //         id: 23,
  //         pid: 22,
  //         icon: "element-icons el-icongongzuotaimoren",
  //         breadcrumb: true
  //       }
  //     }
  //   ]
  // },
  // // 应用中心
  // {
  //     path: '/application-centerAdmin',
  //     name: 'application-centerAdmin',
  //     component: Layout,
  //     meta: { title: '应用中心', id: 26, }, redirect: 'application-center',
  //     children: [
  //         {
  //             name: 'application-center',
  //             path: '/application-center',
  //             component: () =>
  //                 import(/* webpackChunkName: "applicationCenter" */'@/views/application-center'),
  //             meta: { perList: [], title: '应用中心', id: 27, pid: 26, icon: 'element-icons el-iconyingyongzhongxin1' },
  //         },
  //         {
  //             hidden: true,
  //             name: 'centerDetails',
  //             path: '/centerDetails',
  //             component: () =>
  //                 import(/* webpackChunkName: "centerDetails" */'@/views/application-center/centerDetails'),
  //             meta: { perList: [], id: 27, pid: 26, hiddenAPPMain: true, title: '应用中心详情', icon: 'element-icons el-iconyingyongzhongxin1' },
  //         },
  //         {
  //             hidden: true,
  //             name: 'historyDataDetails',
  //             path: '/historyDataDetails',
  //             component: () =>
  //                 import(/* webpackChunkName: "historyDataDetails" */'@/views/application-center/centerDetails/historyData/historyDataDetails/index.vue'),
  //             meta: { perList: [], isBrea: true, id: 27, pid: 26, hiddenAPPMain: true, title: '历史任务详情', icon: 'element-icons el-iconyingyongzhongxin1' },
  //         }
  //     ]
  // },
  // 系统管理
  {
    path: "/systemAdmin",
    component: Layout,
    redirect: "/systemAdmin",
    name: "systemAdmin",
    meta: { title: "系统管理", icon: "new-systemAdmin", id: 28 },
    alwaysShow: true, // 只有一个一级菜单-也需要展开
    children: [
      {
        path: "/systemAdmin/userAdmin",
        name: "userAdmin",
        component: () =>
          import(
            /* webpackChunkName: "userAdmin" */ "@/views/systemAdmin/userAdmin"
          ),
        meta: {
          id: 29,
          pid: 28,
          perList: [],
          title: "用户",
          iotName: "user",
          icon: "new-userAdmin"
        }
      },
      {
        path: "/systemAdmin/roleAdmin",
        name: "roleAdmin",
        component: () =>
          import(
            /* webpackChunkName: "roleAdmin" */ "@/views/systemAdmin/roleAdmin"
          ),
        meta: {
          perList: [],
          id: 30,
          pid: 28,
          title: "角色",
          icon: "new-roleAdmin"
        }
      },
      {
        path: "/systemAdmin/menuAdmin",
        name: "menuAdmin",
        component: () =>
          import(
            /* webpackChunkName: "menuAdmin" */ "@/views/systemAdmin/menuAdmin"
          ),
        meta: {
          perList: [],
          id: 31,
          pid: 28,
          title: "菜单",
          icon: "new-menuAdmin"
        }
      },
      {
        path: "/systemAdmin/department",
        name: "department",
        component: () =>
          import(
            /* webpackChunkName: "department" */ "@/views/systemAdmin/department"
          ),
        meta: {
          perList: [],
          id: 32,
          pid: 28,
          title: "部门",
          icon: "new-department"
        }
      },
      {
        path: "/systemAdmin/resourcesAdmin",
        name: "resourcesAdmin",
        component: () =>
          import(
            /* webpackChunkName: "resourcesAdmin" */ "@/views/systemAdmin/resourcesAdmin"
          ),
        meta: {
          perList: [],
          id: 33,
          pid: 28,
          title: "资源",
          icon: "new-resourcesAdmin"
        }
      }
    ]
  }
  // 404 page must be placed at the end !!!
  // 不需要存储后台
];

const createRouter = () =>
  new Router({
    // mode: 'history', // require service support
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRoutes
    // routes: constantRoutes.concat(asyncRoutes)
  });

const router = createRouter();
// 清除路由
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter();
  router.matcher = newRouter.matcher; // reset router
}

export default router;
